<template>
  <div>
    <!-- <div>{{ row1.join(', ') }}</div>
    <div>{{ row2.join(', ') }}</div> -->
    <div class="color-97a8be">{{ numbers.join(', ') }}</div>
  </div>
</template>

<script>
import _ from 'lodash'

export default {
  props: {
    params: {
      type: Object,
      required: true
    }
  },
  computed: {
    row() {
      return this.params.data
    },
    numbers() {
      return _.sortBy(this.row[this.params.column.colId], (item) => _.toNumber(item))
    },
    row1() {
      const middleIndex = Math.ceil(this.numbers.length / 2) // 计算分割点
      return this.numbers.slice(0, middleIndex) // 第一行数字
    },
    row2() {
      const middleIndex = Math.ceil(this.numbers.length / 2) // 计算分割点
      return this.numbers.slice(middleIndex) // 第二行数字
    }
  }
}
</script>
